home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 138 / 138.xpi / chrome / stumbleupon.jar / content / uninstallDialog.xul < prev    next >
Extensible Markup Language  |  2009-05-22  |  4KB  |  153 lines

  1. <?xml version="1.0"?>
  2.  
  3. <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
  4.  
  5. <!DOCTYPE window SYSTEM "chrome://stumbleupon/locale/stumbleupon.dtd" >
  6.  
  7. <dialog id="stumble_signin_dialog" title="StumbleUpon Uninstall Options"
  8.   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9.   buttons="accept"
  10.   ondialogaccept="return doOK();"
  11.   onload="init()">
  12.  
  13. <stringbundleset id="stringbundleset">
  14.     <stringbundle id="bundle_stumble" src="chrome://stumbleupon/locale/stumbleupon.properties"/>
  15. </stringbundleset>
  16.  
  17. <script type="application/x-javascript">
  18. <![CDATA[
  19.  
  20. var detail;
  21. var logout;
  22. var remove_data;
  23. //var delete_account;
  24.  
  25. function init()
  26. {
  27.     detail = window.arguments[0];
  28.     logout = document.getElementById("logout");
  29.     remove_data = document.getElementById("remove-data");
  30. //    delete_account = document.getElementById("delete-account");
  31.  
  32.     var logout_warning = document.getElementById("logout-warning");
  33.     var label_color = document.defaultView.getComputedStyle(logout_warning, "").getPropertyValue("color");
  34.     
  35.     if (opener.stumbleid != 0)
  36.     {
  37.         var id_str = opener.su_ds.getValue("$nick");
  38.         id_str = (id_str == "") ? opener.stumbleid.toString() : id_str;
  39.         logout.label = "Sign out from account '" + id_str + "'.";
  40.         logout.hidden = false;
  41.         document.getElementById("logout-warning").hidden = false;
  42. //        delete_account.label = "Schedule account '" + id_str + "' to be deleted.";
  43. //        delete_account.hidden = false;
  44.     }
  45.     
  46.     var uninstall = document.getElementById("uninstall");
  47.     setCheckboxLabelColor(uninstall, label_color);
  48.     
  49.     logout.checked = detail.logout;
  50.     logout.setAttribute("checked-preferred", detail.logout);
  51.     setCheckboxLabelColor(logout, label_color);
  52.     
  53.     remove_data.checked = detail.remove_data;
  54.     remove_data.setAttribute("checked-preferred", detail.remove_data);
  55.     setCheckboxLabelColor(remove_data, label_color);
  56.     
  57. //    delete_account.checked = detail.delete_account;
  58. //    delete_account.setAttribute("checked-preferred", detail.delete_account);
  59.  
  60.     refresh();
  61. }
  62.  
  63. function setCheckboxLabelColor(element, color)
  64. {
  65.     var label = document.getAnonymousElementByAttribute(element, "class", "checkbox-label");
  66.     label.setAttribute("style", "color: " + color + ";");
  67. }
  68.  
  69. function refresh()
  70. {
  71.     var logout = document.getElementById("logout");
  72.     var remove_data = document.getElementById("remove-data");
  73. //    var delete_account = document.getElementById("delete-account");
  74.     
  75. //    if (delete_account.checked)
  76. //    {
  77. //        remove_data.checked = true;
  78. //        remove_data.disabled = true;
  79. //    }
  80. //    else
  81. //    {
  82.         remove_data.disabled = false;
  83.         remove_data.checked = (remove_data.getAttribute("checked-preferred") == "true");
  84. //    }
  85.     if (remove_data.checked)
  86.     {
  87.         logout.checked = true;
  88.         logout.disabled = true;
  89.     }
  90.     else
  91.     {
  92.         logout.disabled = false;
  93.         logout.checked = (logout.getAttribute("checked-preferred") == "true");
  94.     }
  95. }
  96.  
  97. function handle_checkbox_command(element)
  98. {
  99.     element.setAttribute("checked-preferred", element.checked);
  100.     refresh();
  101. }
  102.  
  103. function doOK()
  104. {
  105.     detail.logout = logout.checked;
  106.     detail.remove_data = remove_data.checked;
  107. //    detail.delete_account = delete_account.checked;
  108.     
  109.     return true;
  110. }
  111.  
  112.  ]]>
  113. </script>
  114.  
  115. <vbox style="margin:5px">
  116.     <groupbox>
  117.         <caption label="Uninstall Options"/>
  118.         <checkbox id="uninstall"
  119.             label="Uninstall the StumbleUpon Toolbar extension."
  120.             disabled="true"
  121.             checked="true"/>
  122.         <hbox>
  123.             <checkbox id="logout"
  124.                 checked="false"
  125.                 hidden="true"
  126.                 oncommand="handle_checkbox_command(this);"/>
  127.             <spacer flex="1"/>
  128.         </hbox>
  129.         <label id="logout-warning"
  130.             value="WARNING: If you don't know your password, you will LOSE THIS ACCOUNT."
  131.             style="margin-left: 28px;"
  132.             hidden="true"/>
  133.         <hbox>
  134.             <checkbox id="remove-data"
  135.                 label="Remove all configuration files."
  136.                 checked="false"
  137.                 oncommand="handle_checkbox_command(this);"/>
  138.                 <spacer flex="1"/>
  139.         </hbox>
  140. <!--
  141.         <hbox>
  142.             <checkbox id="delete-account"
  143.                 checked="false"
  144.                 hidden="true"
  145.                 oncommand="handle_checkbox_command(this);"/>
  146.             <spacer flex="1"/>
  147.         </hbox>
  148. -->
  149.     </groupbox>
  150. </vbox>
  151.  
  152. </dialog>
  153.